//
//  IslanDescribNearbyTableview.m
//  diaoyuren
//
//  Created by 钓鱼人 on 16/4/4.
//  Copyright © 2016年 game. All rights reserved.
//

#import "IslanDescribNearbyTableview.h"
#import "IsLanTabCell.h"

@interface IslanDescribNearbyTableview ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation IslanDescribNearbyTableview

-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
    if (self = [super initWithFrame:frame style:style]) {
        
        self.separatorStyle = 0;
        self.dataSource = self;
        self.delegate = self;
        
        [self registerNib:[UINib nibWithNibName:@"IsLanTabCell" bundle:nil] forCellReuseIdentifier:@"cell"];
        
    }
    return self;
}

-(void)setListAry:(NSArray *)listAry{
    _listAry = listAry;
    
  
    [self reloadData];

}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.listAry.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    IsLanTabCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    
    if (self.listAry.count>0) {
        
        cell.model = self.listAry[indexPath.row];
    }
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return  SCREEN_HEIGHT*0.13;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    IsLanTabCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    
    [self.Maindelget IsLanTabClickWhithDetail:cell.detail AndLatitude:cell.latitude AndLongitude:cell.longitude AndLocaltion:cell.location AndID:cell.Id];
}

@end
